#include <xp/net/dns.h>
#include <xp/bas/stdio.h>

int xp_main (int argc, xp_char_t* argv[])
{
	xp_dns_t dns;

	if (argc != 2) {
		xp_printf (XP_TEXT("usage: %s hostname\n"), argv[0]);
		return -1;
	}	

	if (xp_dns_open (&dns) == XP_NULL) {
		xp_printf (XP_TEXT("cannot open dns\n"));
		return -1;
	}
	
	xp_dns_query_a (&dns, argv[1]);

	xp_dns_close (&dns);
	return 0;
}
